calculate percentage of marks in Java